import http from "@/api";
import { ResPage } from "@/api/interface";
import {
  CreateCustomerProjectParam,
  EditCustomerProjectInfoParam,
  EditCustomerProjectStatusParam,
  CustomerProjectResult,
  QueryCustomerProjectListParam,
  FindCustomerProjectInfoParam
} from "@/api/interface/customerProject";

const apiName = "CustomerProject";

/** 查询客户项目列表 */
export const queryCustomerProjectList = (param: QueryCustomerProjectListParam) => {
  return http.post<ResPage<CustomerProjectResult>>(`${apiName}/QueryCustomerProjectList`, param);
};

/** 查询我的客户项目列表 */
export const queryMyCustomerProjectList = (param: QueryCustomerProjectListParam) => {
  return http.post<ResPage<CustomerProjectResult>>(`${apiName}/QueryMyCustomerProjectList`, param);
};

export const findCustomerProjectInfo = (param: FindCustomerProjectInfoParam) => {
  return http.post<CustomerProjectResult>(`${apiName}/FindCustomerProjectInfo`, param);
};

/** 创建客户项目 */
export const createCustomerProject = (param: CreateCustomerProjectParam) => {
  return http.post<string>(`${apiName}/CreateCustomerProject`, param);
};

/** 修改客户项目信息 */
export const editCustomerProjectInfo = (param: EditCustomerProjectInfoParam) => {
  return http.post<string>(`${apiName}/EditCustomerProjectInfo`, param);
};

/** 修改客户项目状态 */
export const editCustomerProjectStatus = (param: EditCustomerProjectStatusParam) => {
  return http.post<string>(`${apiName}/EditCustomerProjectStatus`, param);
};
